package com.hongsen.cn.Utils.pinyin;


import com.hongsen.cn.bean.DiagnosisBean;

import java.util.Comparator;

/**
 * 按照字母排序
 */
public class PinyinComparator implements Comparator<DiagnosisBean> {
    public int compare(DiagnosisBean o1, DiagnosisBean o2) {
        if (TextPinyinUtil.getInstance().convert(o1.getLetter().substring(0, 1)).substring(0,1).equals("#")) {
            return -1;
        } else {
            return TextPinyinUtil.getInstance().convert(o1.getLetter().substring(0, 1)).substring(0,1)
                    .compareTo(TextPinyinUtil.getInstance().convert(o2.getLetter().substring(0, 1)).substring(0,1));
        }
    }
}